<template>
    <div>about信息</div>
</template>

<script>
    export default{
            name:'About-test',
           /*  mounted(){
                console.log('about组件挂载了')
            },
            beforeDestroy(){    
                console.log('about销毁了')
            } */
            //进入守卫：通过路由规则，进入该组件时被调用
            beforeRouteEnter (to, from, next) {
                if(to.meta.isAuth){//判断是否需要鉴权
                            if(localStorage.getItem('school')==='heima'){
                                next()
                            }else{
                                alert('学校名不对，无权限查看!!!')
                            }
                        }else{
                            next()
                        }
            },
            //离开守卫：通过路由规则，离开该组件时被调用
            beforeRouteLeave (to, from, next) {
                next()
            }
            }
</script>

<style scoped>

</style>